<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>let 命令-禁止变量提升</title>
    
    <script>
        // 使用var的情况
        console.log(x);// undefined
        var x = 10;
        
        // 使用let的情况
        console.log(y);// ReferenceError: b is not defined
        let y = 20;
    </script>
</head>
<body></body>
</html>